import { createStore, combineReducers, applyMiddleware } from 'redux';
// 导入redux 数据查看 插件
import { composeWithDevTools } from 'redux-devtools-extension';

// 导入中间件
import logger from 'redux-logger';
// 异步action处理中间件
import thunk from 'redux-thunk';

// 导入 reducer
import { todos } from './reducers/todos';
// 其他reducer

// 合并多个reducer
const rootReducer = combineReducers({
  todos,
});

// 创建 store
export const store = createStore(
  rootReducer,
  composeWithDevTools(applyMiddleware(thunk))
);
